<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<%@include file="../../commons/meta.jsp"%>
<c:set var="baseUrl" value="${ctx}api/baokao-guide/" scope="request"/>
<link rel="stylesheet" href="${ctx}assets/plugins/pure/pure-min.css" media="all" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="${ctx}assets/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctx}assets/ueditor/ueditor.all.min.js"></script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="${ctx}assets/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
  //  关闭弹出框
  jQuery(document).ready(function() {
    $("#back_btn").click(function() {
      window.location.href = "${baseUrl}"
    });
  });
</script>
</head>
<body>
    <%@include file="../../commons/head.jsp"%>
    <div class="content">
        <%@include file="../../commons/menu.jsp"%>
        <!--右侧展示部分-->
        <div class="right-zq">
            <!--center content-->
            <div class="dynamic">
                <div class="role dynamiclayer" style="display: block;">
                    <div class="title orange2">
                        <span class="left">高校信息管理</span>
                        <label> > </label>
                        <span>报考指南管理</span>
                        <label> > </label>
                        <span>详情</span>
                    </div>
                    <form class="" id="forms" method="post" action="">
                        <div class="news-table">
                            <table>
                                <tr>
                                    <td class="item">高校:</td>
                                    <td>
                                        <input class="p50" id="collegeName" name="collegeName" type="text" value="${obj.collegeName}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">标题:</td>
                                    <td><input class="p50" id="title" name="title" type="text" value="${obj.title}" /></td>
                                </tr>
                                <tr>
                                    <td class="item">年份:</td>
                                    <td>
                                        <select id="year" name="year" class="p20" style="text-align: center;"></select>
                                    </td>
                                </tr>
                                <div style="display: none">
                                    <textarea name="content" id="content"></textarea>
                                </div>
                                <tr>
                                    <td colspan="2" id="my_editor">
                                        <div style="width: 1000px;">
                                            <script id="editor" type="text/plain" style="height: 400px;"></script>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>
                                        <button class="orange2" type="button" id="back_btn">
                                            <fmt:message key='sys.exit' />
                                            &nbsp;<i class="fa fa-undo"></i>
                                        </button>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </form>
                </div>
            </div>
            <!--center content over-->
        </div>
    </div>
    <%@include file="../../commons/footpop.jsp"%>
    <!-- 页尾，提示消息 -->
    <jsp:include page="../../commons/foot_message.jsp"></jsp:include>
    <script>
        // 初始化富文本框编辑器
        var ue = UE.getEditor('editor');
        ue.addListener("ready", function() {
          var content = '${obj.content}';
          ue.setContent(content);
          UE.getEditor('editor').body.innerHTML = content;
        });

        // 设置年份下拉框
        function setYearSelect() {
          var orgYear = '${obj.year}';
          var yearArr = getYearArr(null, null);
          var size = yearArr.length;
          var option = "";
          // 倒序遍历
          for (var i = size - 1; i > 0; i--) {
            if (orgYear == yearArr[i]) {
              option += "<option selected='selected' value='" + yearArr[i] + "'>" + yearArr[i] + "</option>";
            } else {
              option += "<option value='" + yearArr[i] + "'>" + yearArr[i] + "</option>";
            }
          }
          $("#year").html(option);
        }

        // 进入页面，默认执行
        setYearSelect();
    </script>
</body>
</html>
